<?php
App::import('Model','Config.BaseConfig');
/**
 * @page general_config General Configuration
 * 
 * These are general configurations which can be used to alter various functions on website globally.
 * 
 * @li <b>Disable html editor</b> - Checking this box will disable HTML editor on whole website.
 * @li <b>Disable editor reviews</b> - Checking this box will disable 'Editorial reviews' on whole website.
 * @li <b>Enable tags</b> - Checking this box will add an input field for tags on listing submission form for users to to add tags for that listing.
 * @li <b>Enable breadcrumbs</b> - Checking this box will display breadcrumb navigation to users of whole website.
 * @li <b>Allow comments on gallery</b> - Checking this box will allow registered users to post their comments of gallery pics.
 * @li <b>Allow guest comments on gallery</b> - Checking this box will allow guest users to post comments on gallery pics.
 * @li <b>Enable captcha on guest comments form</b> - Checking this box will add a captcha on comment add form of guest users.
 * @li <b>Moderate gallery comments</b> - Checking this box will submit all posted comments to admin for approval first, instead of publishing the comments directly on website.
 * @li <b>Send an activation email to user on registration</b> - Checking this box will force users to verify their email address before becoming a member with website.
 * @li <b>Use default logo</b> - Checking this box will use default logo of the theme you are using instead of the logo uploaded by you from admin panel.
 * @li <b>Upload Custom logo</b> - You can upload logo for your website from here.
 * @li <b>Upload favicon</b> - You can upload your custom favicon for your website here. (32x32 preferred).
 * @li <b>Enable Captcha on registration</b> - Checking this box will add a captcha on registeration form.
 */
class GeneralConfig extends BaseConfig
{
	var $name = 'GeneralConfig';
	
	var $cache = true;
	
	var $fieldProperties = array(
							'disable_html_editor'=>array(
								'label'=>'Disable html editor',
								'type'=>'checkbox',
								'group'=>'add',
								'tooltip'=>'Checking this box will disable HTML editor on whole website.',
								'default'=>true
			
								),
							'disable_editor_reviews'=>array(
								'label'=>'Disable editor reviews',
								'type'=>'checkbox',
								'group'=>'add',	
								'tooltip'=>'Checking this box will disable \'Editor reviews\' on whole website.'),
							'enable_tags'=>array(
								'label'=>'Enable tags',
								'type'=>'checkbox',
								'group'=>'add',
								'default'=>'1',
								'tooltip'=>'Uncheck this box if you wish to remove input field for tags from listing submission form'
								),
							'enable_breadcrumb'=>array(
								'label'=>'Enable breadcrumbs',
								'type'=>'checkbox',
								'group'=>array('add'),
								'default'=>1									
								),
							'allow_comment_on_gallery'=>array(
								'label'=>'Allow comments on gallery',
								'type'=>'checkbox',
								'group'=>'add',
								'default'=>1
								),
							'allow_guest_comment_on_gallery'=>array(
								'label'=>'Allow guest comments on gallery',
								'type'=>'checkbox',
								'group'=>'add',
								'default'=>1,
								'class'=>'guestCommentGallery',
								'onchange'=>'toggleCaptcha("guestCommentGallery","galleryCommentCaptcha");'
								),
							'captha_on_gallery_guest_comment'=>array(
								'label'=>'Enable captcha on guest comments form',
								'type'=>'checkbox',
								'group'=>'add',
								'default'=>1,
								'class'=>'galleryCommentCaptcha'								
								),
							'moderate_gallery_comment'=>array(
								'label'=>'Moderate gallery comments',
								'type'=>'checkbox',
								'group'=>'add',
								'default'=>1
								),
							'send_activation_email'=>array('default'=>1,
									'label'=>"Send an activation email to user on registration",
									'type'=>"checkbox",
									'group'=>"add"
								),
								'use_default_logo'=>array(
								'label'=>'Use default logo',
								'type'=>'checkbox',
								'group'=>'add',
								'default'=>1
								),
							'logo'=>array(
								'label'=>'Upload Custom logo',
								'type'=>'file',
								'group'=>'add',
								'tooltip'=>'You can upload your custom logo for your website here. If you\'re using default theme, upload a logo with 300x80 dimensions'
								),
							'fav_icon'=>array(
								'label'=>'Upload favicon',
								'type'=>'file',
								'group'=>'add',
								'tooltip'=>'You can upload your custom favicon for your website here. (32x32 preferred)'
								),
							'captcha_on_register'=>array(
								'label'=>'Enable Captcha on registration',
								'type'=>'checkbox',
								'group'=>'add',
								'default'=>1,
								'tooltip'=>'Enable Captcha on registration'
								),
							'analytics_code'=>array(
									'label'=>"Analytics Code",
									'type'=>"textarea",
									'group'=>"add",
									'tooltip' =>"Html code of your analytics, which will be added in header added.",
								),
                'lightboxGallery' => array(
                   'label' => "Show images in lightbox?",
                   'options' => array("No","Yes"),
                   'group'=> array("add"),
               ),    
							'ffmpegPath' => array("label"=>"FFMPEG file path","type"=>"text",'group'=>"add",'title'=>"Path to ffmpeg software.Required for Video fields")
							);
						
	var $actsAs = array(
					'Cms.Upload'=>array(
							'logo'=>array('mediaTypes'=>array("Image"),'dir'=>'{WWW_ROOT}{DS}uploads{DS}logo'),
							'fav_icon'=>array('mediaTypes'=>array(
									"Image"=>array(
									'allowedMime'=>array("image/*"),
									'allowedExt'=>array('ico'),
									'resolution'=>array(
										'min'=>array('x'=>32,'y'=>32),
										'max'=>array('x'=>432,'y'=>432)
									),
								)),'dir'=>'{WWW_ROOT}{DS}uploads{DS}fav_icon')
					));

		function init()
		{
			parent::init();
			Configure::write("cms.Upload.ffmpegPath",cr("GeneralConfig.ffmpegPath"));
		}
}
?>